import request from '@/utils/request'

export function getAllRole() {
  return request({
    url: '/role/selectAllForUser',
    method: 'get'
  })
}

export function getAllUser(size, page) {
  return request({
    url: '/user/all',
    method: 'get',
    params: {
      size: size,
      page: page
    }
  })
}

export function updateUser(user) {
  return request({
    url: '/user/update',
    method: 'put',
    params: {
      userId: user.userId,
      userName: user.userName,
      userPassword: user.userPassword,
      userState: user.userState,
      userPhone: user.userPhone,
      userMail: user.userMail
    }
  })
}

export function deleteUser(userID) {
  return request({
    url: '/user/delete',
    method: 'get',
    params: {
      userId: userID
    }
  })
}
